package com.nkym.wypan.storage.core;


import com.nkym.wypan.storage.context.*;

import com.nkym.wypan.storage.response.UploadResult;

import java.io.IOException;
import java.io.OutputStream;

public interface StorageEngine {

    UploadResult upload(FileUpload fileUpload) throws IOException;

    void download(Download download);

    /**
     * 普通文件预览
     *
     * @param previewRequest
     */
    void preview(PreviewRequest previewRequest);

    /**
     * @param realPath      真实文件路径
     * @param outputStream  文件输出流
     * @param startPosition 文件读入位置
     * @param size          每次读入大小
     */
    void download(String realPath, OutputStream outputStream, Long startPosition, Long size);

    /**
     * 视频文件预览
     *
     * @param
     * @return
     * @throws IOException
     */



    UploadResult chunkUpload(ChunkUpload chunkUpload) throws IOException;

    UploadResult mergeChunk(MergeRequest chunkRequest) throws IOException;

    ;

    void delete(DeleteRequest deleteRequest);
}
